import request from '@/utils/request'
import { AxiosPromise } from 'axios'
import { CustomerQuery } from '@/api/business/customer/types'

enum Api {
  list = '/customer/block/list',
  remove = '/customer/block/remove',
  batchRemove = '/customer/block/batchRemove',
  detail = '/customer/block/detail',
}

// 获取列表
export const list = (data: any): AxiosPromise<any> => {
  return request({
    url: Api.list,
    method: 'post',
    data,
  })
}

// 删除
export const remove = (data: string) => {
  return request({
    url: Api.remove,
    method: 'post',
    data,
  })
}
// 批量删除
export const batchRemove = (data: (string | number)[]) => {
  return request({
    url: Api.batchRemove,
    method: 'post',
    data,
  })
}

// 获取设备详情
export const detail = (data: CustomerQuery) => {
  return request({
    url: Api.detail,
    method: 'post',
    data,
  })
}
